package com.iap.client.context
{
	import com.iap.admin.command.TagCommand;
	import com.iap.admin.service.ITagService;
	import com.iap.admin.service.TagService;
	import com.iap.admin.signal.VectorRequestSignal;
	import com.iap.app.data.AppData;
	import com.iap.app.data.IAppData;
	import com.iap.client.mediator.ClientMediator;
	import com.iap.client.mediator.FavoriteMediator;
	import com.iap.client.mediator.FilterMediator;
	import com.iap.client.mediator.VectorFilterResultMediator;
	import com.iap.client.view.ClientView;
	import com.iap.client.view.FilterView;
	import com.iap.client.view.VectorFilterResultView;
	import com.iap.client.view.favorite.FavoriteView;
	import com.iap.common.command.ClientCommand;
	import com.iap.common.command.ClientLiteCommand;
	import com.iap.common.command.FavoriteCommand;
	import com.iap.common.command.InstanceCommand;
	import com.iap.common.command.VectorByTagCommand;
	import com.iap.common.command.VectorCommand;
	import com.iap.common.service.ClientLiteService;
	import com.iap.common.service.ClientService;
	import com.iap.common.service.FavoriteService;
	import com.iap.common.service.IClientLiteService;
	import com.iap.common.service.IClientService;
	import com.iap.common.service.IFavoriteService;
	import com.iap.common.service.IInstanceService;
	import com.iap.common.service.IVectorService;
	import com.iap.common.service.InstanceService;
	import com.iap.common.service.VectorService;
	import com.iap.common.signal.ClientLiteRequestSignal;
	import com.iap.common.signal.ClientRequestSignal;
	import com.iap.common.signal.FavoriteRequestSignal;
	import com.iap.common.signal.InstanceRequestSignal;
	import com.iap.common.signal.TagRequestSignal;
	import com.iap.common.signal.VectorByTagRequestSignal;
	
	import org.robotlegs.base.SignalCommandMap;
	import org.robotlegs.mvcs.Context;
	import org.robotlegs.mvcs.SignalContext;
	
	public class ClientContext extends SignalContext
	{
		override public function startup():void
		{
			injector.mapSingletonOf(IAppData, AppData);
			injector.mapSingletonOf(IFavoriteService, FavoriteService);
			injector.mapSingletonOf(ITagService, TagService);
			injector.mapSingletonOf(IClientLiteService, ClientLiteService);
			injector.mapSingletonOf(IClientService, ClientService);
			injector.mapSingletonOf(IInstanceService, InstanceService);

			signalCommandMap.mapSignalClass(FavoriteRequestSignal, FavoriteCommand);
			signalCommandMap.mapSignalClass(ClientLiteRequestSignal, ClientLiteCommand);
			signalCommandMap.mapSignalClass(ClientRequestSignal, ClientCommand);
			signalCommandMap.mapSignalClass(InstanceRequestSignal, InstanceCommand);

			mediatorMap.mapView(FavoriteView, FavoriteMediator);

			signalCommandMap.mapSignalClass(TagRequestSignal, TagCommand);
			mediatorMap.mapView(FilterView, FilterMediator);

			injector.mapSingletonOf(IVectorService, VectorService);
			signalCommandMap.mapSignalClass(VectorByTagRequestSignal, VectorByTagCommand);
			mediatorMap.mapView(VectorFilterResultView, VectorFilterResultMediator);

			mediatorMap.mapView(ClientView, ClientMediator);
		}
	}
}